/***************************************************************************
 *   Copyright (C) 2009 by Docteur Pierre-Marie Desombre.   *
 *   pm.desombre@medsyn.fr  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 3 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef BMI_H
#define BMI_H

#include <QtGui>
#include <QtCore>

class bmi:public QObject
{
  Q_OBJECT
  public :
    bmi(QStandardItemModel * model = 0);
    ~bmi();
    void        calc();
    QHash<QString,QString> m_hashNumberOfWeightValues;
  private :
    //void lissage(QMultiMap<int,QString> & /*multiHash*/);
    void createAPointBecauseUniqueValue();
    QString     m_sexe;
    QString     m_dateOfBirth;
    QStandardItemModel * m_model;
    QHash<int,QString> m_maxAbaqueHash;//<age,height of child>
  protected:
    void test();
    bool bmiOneToFiveOverVariation();
    bool bmiAdultOverVariation();
    bool bmiChildSixToTwentyOneOverVariation();
    bool isItAnAbnormalHeightVariation();
    void myMessage(QString &,QString &,QString & );
    void fillMaximumAbaqueHash(QString & /*sexe*/);
    int  ageCalculated(QDate & /*date*/);
    int  m_AgeCalc;
    bool m_obesity ;
};

#endif
